package com.wjc.homework;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

/**
 * @author wang'ji'cheng
 * @date 2025/7/12
 */
public class Homework04 {
    public static void main(String[] args) {
        int [] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        System.out.println(Arrays.toString(copyArr(arr)));
    }
    //编写一个array的复制方法，返回一个新数组
    public static int[] copyArr(int[] arr) {
        int [] newArr = new int[arr.length];
        for (int i = 0; i < arr.length; i++) {
            newArr[i] =  arr[i];
        }
        return newArr;
    }
}
